In [4]:
!pip install pandas matplotlib
Requirement already satisfied: pandas in c:\users\p2112675\.conda\envs\tfsklearn\lib\site-packages (1.5.3)
Collecting matplotlib
  Using cached matplotlib-3.6.3-cp38-cp38-win_amd64.whl (7.2 MB)
Requirement already satisfied: python-dateutil>=2.8.1 in c:\users\p2112675\.conda\envs\tfsklearn\lib\site-packages (from pandas) (2.8.2)
Requirement already satisfied: numpy>=1.20.3 in c:\users\p2112675\.conda\envs\tfsklearn\lib\site-packages (from pandas) (1.24.1)
Requirement already satisfied: pytz>=2020.1 in c:\users\p2112675\.conda\envs\tfsklearn\lib\site-packages (from pandas) (2022.7.1)
Collecting pyparsing>=2.2.1
  Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
Requirement already satisfied: packaging>=20.0 in c:\users\p2112675\.conda\envs\tfsklearn\lib\site-packages (from matplotlib) (23.0)
Collecting kiwisolver>=1.0.1
  Using cached kiwisolver-1.4.4-cp38-cp38-win_amd64.whl (55 kB)
Collecting pillow>=6.2.0
  Using cached Pillow-9.4.0-cp38-cp38-win_amd64.whl (2.5 MB)
Collecting cycler>=0.10
  Using cached cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting contourpy>=1.0.1
  Using cached contourpy-1.0.7-cp38-cp38-win_amd64.whl (162 kB)
Collecting fonttools>=4.22.0
  Using cached fonttools-4.38.0-py3-none-any.whl (965 kB)
Requirement already satisfied: six>=1.5 in c:\users\p2112675\.conda\envs\tfsklearn\lib\site-packages (from python-dateutil>=2.8.1->pandas) (1.16.0)
Installing collected packages: pyparsing, pillow, kiwisolver, fonttools, cycler, contourpy, matplotlib
Successfully installed contourpy-1.0.7 cycler-0.11.0 fonttools-4.38.0 kiwisolver-1.4.4 matplotlib-3.6.3 pillow-9.4.0 pyparsing-3.0.9
In [6]:
conda install -c intel scikit-learn
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done

## Package Plan ##

  environment location: C:\Users\p2112675\.conda\envs\tfsklearn

  added / updated specs:
    - scikit-learn


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    ca-certificates-2022.10.11 |       haa95532_0         164 KB  intel
    certifi-2022.9.24          |   py38haa95532_0         158 KB  intel
    dpcpp-cpp-rt-2023.0.0      |      intel_25922         2.1 MB  intel
    dpcpp_cpp_rt-2023.0.0      |      intel_25922          20 KB  intel
    fortran_rt-2023.0.0        |      intel_25922          20 KB  intel
    icc_rt-2023.0.0            |      intel_25922          20 KB  intel
    impi_rt-2021.8.0           |      intel_25543         9.1 MB  intel
    intel-cmplr-lib-rt-2023.0.0|      intel_25922        16.1 MB  intel
    intel-cmplr-lic-rt-2023.0.0|      intel_25922          48 KB  intel
    intel-fortran-rt-2023.0.0  |      intel_25922         3.5 MB  intel
    intel-opencl-rt-2023.0.0   |      intel_25922        92.9 MB  intel
    intel-openmp-2023.0.0      |      intel_25922         3.2 MB  intel
    intelpython-2023.0.0       |                1           5 KB  intel
    joblib-1.0.1               |     pyh3f38642_3         207 KB  intel
    mkl-2023.0.0               |      intel_25930       178.8 MB  intel
    mkl-service-2.4.0          |  py38h5809ae4_14          48 KB  intel
    mkl_fft-1.3.1              |  py38ha0f7485_22         258 KB  intel
    mkl_random-1.2.2           |  py38ha2798aa_22         379 KB  intel
    mkl_umath-0.1.1            |  py38h82923ec_32         277 KB  intel
    numpy-1.22.3               |   py38hf0956d0_5           4 KB  intel
    numpy-base-1.22.3          |   py38he60c17a_5         5.7 MB  intel
    openssl-1.1.1q             |       h2bbff1b_0         5.7 MB  intel
    scikit-learn-1.1.1         |   py38hd77b12b_0         7.5 MB  intel
    scipy-1.7.3                |   py38h38b71fe_6        29.9 MB  intel
    six-1.16.0                 |     pyhd3eb1b0_1          19 KB  intel
    tbb-2021.8.0               | vc14_intel_25874         218 KB  intel
    tbb4py-2021.8.0            | py38_intel_25874          74 KB  intel
    threadpoolctl-2.2.0        |     pyh0d69192_0          16 KB  intel
    ------------------------------------------------------------
                                           Total:       356.6 MB

The following NEW packages will be INSTALLED:

  dpcpp-cpp-rt       intel/win-64::dpcpp-cpp-rt-2023.0.0-intel_25922
  dpcpp_cpp_rt       intel/win-64::dpcpp_cpp_rt-2023.0.0-intel_25922
  fortran_rt         intel/win-64::fortran_rt-2023.0.0-intel_25922
  icc_rt             intel/win-64::icc_rt-2023.0.0-intel_25922
  impi_rt            intel/win-64::impi_rt-2021.8.0-intel_25543
  intel-cmplr-lib-rt intel/win-64::intel-cmplr-lib-rt-2023.0.0-intel_25922
  intel-cmplr-lic-rt intel/win-64::intel-cmplr-lic-rt-2023.0.0-intel_25922
  intel-fortran-rt   intel/win-64::intel-fortran-rt-2023.0.0-intel_25922
  intel-opencl-rt    intel/win-64::intel-opencl-rt-2023.0.0-intel_25922
  intel-openmp       intel/win-64::intel-openmp-2023.0.0-intel_25922
  intelpython        intel/win-64::intelpython-2023.0.0-1
  joblib             intel/noarch::joblib-1.0.1-pyh3f38642_3
  mkl                intel/win-64::mkl-2023.0.0-intel_25930
  mkl-service        intel/win-64::mkl-service-2.4.0-py38h5809ae4_14
  mkl_fft            intel/win-64::mkl_fft-1.3.1-py38ha0f7485_22
  mkl_random         intel/win-64::mkl_random-1.2.2-py38ha2798aa_22
  mkl_umath          intel/win-64::mkl_umath-0.1.1-py38h82923ec_32
  numpy              intel/win-64::numpy-1.22.3-py38hf0956d0_5
  numpy-base         intel/win-64::numpy-base-1.22.3-py38he60c17a_5
  scikit-learn       intel/win-64::scikit-learn-1.1.1-py38hd77b12b_0
  scipy              intel/win-64::scipy-1.7.3-py38h38b71fe_6
  six                intel/noarch::six-1.16.0-pyhd3eb1b0_1
  tbb                intel/win-64::tbb-2021.8.0-vc14_intel_25874
  tbb4py             intel/win-64::tbb4py-2021.8.0-py38_intel_25874
  threadpoolctl      intel/noarch::threadpoolctl-2.2.0-pyh0d69192_0

The following packages will be SUPERSEDED by a higher-priority channel:

  ca-certificates    pkgs/main::ca-certificates-2023.01.10~ --> intel::ca-certificates-2022.10.11-haa95532_0
  certifi            pkgs/main::certifi-2022.12.7-py38haa9~ --> intel::certifi-2022.9.24-py38haa95532_0
  openssl              pkgs/main::openssl-1.1.1s-h2bbff1b_0 --> intel::openssl-1.1.1q-h2bbff1b_0



Downloading and Extracting Packages

tbb4py-2021.8.0      | 74 KB     |            |   0% 
tbb4py-2021.8.0      | 74 KB     | ##1        |  22% 
tbb4py-2021.8.0      | 74 KB     | ####3      |  43% 
tbb4py-2021.8.0      | 74 KB     | ########6  |  86% 
tbb4py-2021.8.0      | 74 KB     | ########## | 100% 

intel-cmplr-lib-rt-2 | 16.1 MB   |            |   0% 
intel-cmplr-lib-rt-2 | 16.1 MB   |            |   0% 
intel-cmplr-lib-rt-2 | 16.1 MB   |            |   0% 
intel-cmplr-lib-rt-2 | 16.1 MB   | 1          |   1% 
intel-cmplr-lib-rt-2 | 16.1 MB   | 1          |   2% 
intel-cmplr-lib-rt-2 | 16.1 MB   | 3          |   3% 
intel-cmplr-lib-rt-2 | 16.1 MB   | 6          |   7% 
intel-cmplr-lib-rt-2 | 16.1 MB   | #3         |  13% 
intel-cmplr-lib-rt-2 | 16.1 MB   | ##6        |  26% 
intel-cmplr-lib-rt-2 | 16.1 MB   | ####6      |  47% 
intel-cmplr-lib-rt-2 | 16.1 MB   | #####4     |  55% 
intel-cmplr-lib-rt-2 | 16.1 MB   | ######8    |  69% 
intel-cmplr-lib-rt-2 | 16.1 MB   | ########8  |  89% 
intel-cmplr-lib-rt-2 | 16.1 MB   | #########9 | 100% 
intel-cmplr-lib-rt-2 | 16.1 MB   | ########## | 100% 

numpy-base-1.22.3    | 5.7 MB    |            |   0% 
numpy-base-1.22.3    | 5.7 MB    |            |   0% 
numpy-base-1.22.3    | 5.7 MB    | ######1    |  61% 
numpy-base-1.22.3    | 5.7 MB    | #########7 |  97% 
numpy-base-1.22.3    | 5.7 MB    | ########## | 100% 

intelpython-2023.0.0 | 5 KB      |            |   0% 
intelpython-2023.0.0 | 5 KB      | ########## | 100% 
intelpython-2023.0.0 | 5 KB      | ########## | 100% 

dpcpp_cpp_rt-2023.0. | 20 KB     |            |   0% 
dpcpp_cpp_rt-2023.0. | 20 KB     | #######8   |  79% 
dpcpp_cpp_rt-2023.0. | 20 KB     | ########## | 100% 

openssl-1.1.1q       | 5.7 MB    |            |   0% 
openssl-1.1.1q       | 5.7 MB    |            |   0% 
openssl-1.1.1q       | 5.7 MB    | ######2    |  63% 
openssl-1.1.1q       | 5.7 MB    | ########## | 100% 
openssl-1.1.1q       | 5.7 MB    | ########## | 100% 

tbb-2021.8.0         | 218 KB    |            |   0% 
tbb-2021.8.0         | 218 KB    | 7          |   7% 
tbb-2021.8.0         | 218 KB    | ########## | 100% 

mkl-service-2.4.0    | 48 KB     |            |   0% 
mkl-service-2.4.0    | 48 KB     | ###3       |  34% 
mkl-service-2.4.0    | 48 KB     | ########## | 100% 

fortran_rt-2023.0.0  | 20 KB     |            |   0% 
fortran_rt-2023.0.0  | 20 KB     | #######8   |  79% 
fortran_rt-2023.0.0  | 20 KB     | ########## | 100% 

intel-cmplr-lic-rt-2 | 48 KB     |            |   0% 
intel-cmplr-lic-rt-2 | 48 KB     | ###3       |  34% 
intel-cmplr-lic-rt-2 | 48 KB     | ########## | 100% 

mkl_umath-0.1.1      | 277 KB    |            |   0% 
mkl_umath-0.1.1      | 277 KB    | 5          |   6% 
mkl_umath-0.1.1      | 277 KB    | ########## | 100% 

scikit-learn-1.1.1   | 7.5 MB    |            |   0% 
scikit-learn-1.1.1   | 7.5 MB    |            |   0% 
scikit-learn-1.1.1   | 7.5 MB    | ####9      |  49% 
scikit-learn-1.1.1   | 7.5 MB    | #########3 |  94% 
scikit-learn-1.1.1   | 7.5 MB    | ########## | 100% 

intel-openmp-2023.0. | 3.2 MB    |            |   0% 
intel-openmp-2023.0. | 3.2 MB    |            |   0% 
intel-openmp-2023.0. | 3.2 MB    | ########## | 100% 
intel-openmp-2023.0. | 3.2 MB    | ########## | 100% 

impi_rt-2021.8.0     | 9.1 MB    |            |   0% 
impi_rt-2021.8.0     | 9.1 MB    |            |   0% 
impi_rt-2021.8.0     | 9.1 MB    | ####1      |  41% 
impi_rt-2021.8.0     | 9.1 MB    | #######3   |  74% 
impi_rt-2021.8.0     | 9.1 MB    | #########3 |  93% 
impi_rt-2021.8.0     | 9.1 MB    | ########## | 100% 

intel-fortran-rt-202 | 3.5 MB    |            |   0% 
intel-fortran-rt-202 | 3.5 MB    |            |   0% 
intel-fortran-rt-202 | 3.5 MB    | #########5 |  96% 
intel-fortran-rt-202 | 3.5 MB    | ########## | 100% 

mkl_random-1.2.2     | 379 KB    |            |   0% 
mkl_random-1.2.2     | 379 KB    | 4          |   4% 
mkl_random-1.2.2     | 379 KB    | ########## | 100% 
mkl_random-1.2.2     | 379 KB    | ########## | 100% 

mkl_fft-1.3.1        | 258 KB    |            |   0% 
mkl_fft-1.3.1        | 258 KB    | 6          |   6% 
mkl_fft-1.3.1        | 258 KB    | ########## | 100% 

dpcpp-cpp-rt-2023.0. | 2.1 MB    |            |   0% 
dpcpp-cpp-rt-2023.0. | 2.1 MB    |            |   1% 
dpcpp-cpp-rt-2023.0. | 2.1 MB    | ########## | 100% 
dpcpp-cpp-rt-2023.0. | 2.1 MB    | ########## | 100% 

icc_rt-2023.0.0      | 20 KB     |            |   0% 
icc_rt-2023.0.0      | 20 KB     | #######8   |  79% 
icc_rt-2023.0.0      | 20 KB     | ########## | 100% 

ca-certificates-2022 | 164 KB    |            |   0% 
ca-certificates-2022 | 164 KB    | 9          |  10% 
ca-certificates-2022 | 164 KB    | ########## | 100% 

mkl-2023.0.0         | 178.8 MB  |            |   0% 
mkl-2023.0.0         | 178.8 MB  |            |   0% 
mkl-2023.0.0         | 178.8 MB  | 2          |   2% 
mkl-2023.0.0         | 178.8 MB  | 4          |   4% 
mkl-2023.0.0         | 178.8 MB  | 5          |   5% 
mkl-2023.0.0         | 178.8 MB  | 6          |   6% 
mkl-2023.0.0         | 178.8 MB  | 7          |   7% 
mkl-2023.0.0         | 178.8 MB  | 8          |   8% 
mkl-2023.0.0         | 178.8 MB  | #          |  10% 
mkl-2023.0.0         | 178.8 MB  | #1         |  11% 
mkl-2023.0.0         | 178.8 MB  | #2         |  12% 
mkl-2023.0.0         | 178.8 MB  | #3         |  14% 
mkl-2023.0.0         | 178.8 MB  | #4         |  15% 
mkl-2023.0.0         | 178.8 MB  | #5         |  16% 
mkl-2023.0.0         | 178.8 MB  | #6         |  17% 
mkl-2023.0.0         | 178.8 MB  | #7         |  18% 
mkl-2023.0.0         | 178.8 MB  | #8         |  19% 
mkl-2023.0.0         | 178.8 MB  | #9         |  20% 
mkl-2023.0.0         | 178.8 MB  | ##         |  21% 
mkl-2023.0.0         | 178.8 MB  | ##1        |  22% 
mkl-2023.0.0         | 178.8 MB  | ##2        |  23% 
mkl-2023.0.0         | 178.8 MB  | ##3        |  24% 
mkl-2023.0.0         | 178.8 MB  | ##4        |  25% 
mkl-2023.0.0         | 178.8 MB  | ##5        |  25% 
mkl-2023.0.0         | 178.8 MB  | ##6        |  26% 
mkl-2023.0.0         | 178.8 MB  | ##7        |  27% 
mkl-2023.0.0         | 178.8 MB  | ##8        |  28% 
mkl-2023.0.0         | 178.8 MB  | ##9        |  29% 
mkl-2023.0.0         | 178.8 MB  | ###        |  30% 
mkl-2023.0.0         | 178.8 MB  | ###1       |  32% 
mkl-2023.0.0         | 178.8 MB  | ###3       |  33% 
mkl-2023.0.0         | 178.8 MB  | ###4       |  34% 
mkl-2023.0.0         | 178.8 MB  | ###4       |  35% 
mkl-2023.0.0         | 178.8 MB  | ###5       |  35% 
mkl-2023.0.0         | 178.8 MB  | ###5       |  36% 
mkl-2023.0.0         | 178.8 MB  | ###6       |  36% 
mkl-2023.0.0         | 178.8 MB  | ###6       |  36% 
mkl-2023.0.0         | 178.8 MB  | ###7       |  37% 
mkl-2023.0.0         | 178.8 MB  | ###7       |  38% 
mkl-2023.0.0         | 178.8 MB  | ###9       |  39% 
mkl-2023.0.0         | 178.8 MB  | ####       |  40% 
mkl-2023.0.0         | 178.8 MB  | ####       |  41% 
mkl-2023.0.0         | 178.8 MB  | ####2      |  42% 
mkl-2023.0.0         | 178.8 MB  | ####4      |  44% 
mkl-2023.0.0         | 178.8 MB  | ####5      |  45% 
mkl-2023.0.0         | 178.8 MB  | ####6      |  47% 
mkl-2023.0.0         | 178.8 MB  | ####8      |  48% 
mkl-2023.0.0         | 178.8 MB  | ####9      |  49% 
mkl-2023.0.0         | 178.8 MB  | #####      |  51% 
mkl-2023.0.0         | 178.8 MB  | #####1     |  51% 
mkl-2023.0.0         | 178.8 MB  | #####2     |  53% 
mkl-2023.0.0         | 178.8 MB  | #####3     |  54% 
mkl-2023.0.0         | 178.8 MB  | #####4     |  55% 
mkl-2023.0.0         | 178.8 MB  | #####6     |  56% 
mkl-2023.0.0         | 178.8 MB  | #####7     |  57% 
mkl-2023.0.0         | 178.8 MB  | #####8     |  59% 
mkl-2023.0.0         | 178.8 MB  | ######     |  61% 
mkl-2023.0.0         | 178.8 MB  | ######1    |  62% 
mkl-2023.0.0         | 178.8 MB  | ######2    |  63% 
mkl-2023.0.0         | 178.8 MB  | ######4    |  64% 
mkl-2023.0.0         | 178.8 MB  | ######6    |  66% 
mkl-2023.0.0         | 178.8 MB  | ######7    |  67% 
mkl-2023.0.0         | 178.8 MB  | ######8    |  68% 
mkl-2023.0.0         | 178.8 MB  | #######    |  70% 
mkl-2023.0.0         | 178.8 MB  | #######    |  71% 
mkl-2023.0.0         | 178.8 MB  | #######2   |  72% 
mkl-2023.0.0         | 178.8 MB  | #######4   |  74% 
mkl-2023.0.0         | 178.8 MB  | #######6   |  76% 
mkl-2023.0.0         | 178.8 MB  | #######7   |  77% 
mkl-2023.0.0         | 178.8 MB  | #######8   |  78% 
mkl-2023.0.0         | 178.8 MB  | #######8   |  79% 
mkl-2023.0.0         | 178.8 MB  | #######9   |  79% 
mkl-2023.0.0         | 178.8 MB  | ########   |  80% 
mkl-2023.0.0         | 178.8 MB  | ########1  |  81% 
mkl-2023.0.0         | 178.8 MB  | ########2  |  82% 
mkl-2023.0.0         | 178.8 MB  | ########3  |  83% 
mkl-2023.0.0         | 178.8 MB  | ########4  |  84% 
mkl-2023.0.0         | 178.8 MB  | ########4  |  85% 
mkl-2023.0.0         | 178.8 MB  | ########6  |  86% 
mkl-2023.0.0         | 178.8 MB  | ########7  |  87% 
mkl-2023.0.0         | 178.8 MB  | ########8  |  88% 
mkl-2023.0.0         | 178.8 MB  | ########9  |  89% 
mkl-2023.0.0         | 178.8 MB  | #########  |  90% 
mkl-2023.0.0         | 178.8 MB  | #########1 |  91% 
mkl-2023.0.0         | 178.8 MB  | #########2 |  92% 
mkl-2023.0.0         | 178.8 MB  | #########3 |  93% 
mkl-2023.0.0         | 178.8 MB  | #########4 |  94% 
mkl-2023.0.0         | 178.8 MB  | #########5 |  95% 
mkl-2023.0.0         | 178.8 MB  | #########6 |  96% 
mkl-2023.0.0         | 178.8 MB  | #########7 |  97% 
mkl-2023.0.0         | 178.8 MB  | #########8 |  98% 
mkl-2023.0.0         | 178.8 MB  | #########9 |  99% 
mkl-2023.0.0         | 178.8 MB  | ########## | 100% 

scipy-1.7.3          | 29.9 MB   |            |   0% 
scipy-1.7.3          | 29.9 MB   |            |   0% 
scipy-1.7.3          | 29.9 MB   |            |   0% 
scipy-1.7.3          | 29.9 MB   |            |   0% 
scipy-1.7.3          | 29.9 MB   |            |   1% 
scipy-1.7.3          | 29.9 MB   | 1          |   1% 
scipy-1.7.3          | 29.9 MB   | 2          |   2% 
scipy-1.7.3          | 29.9 MB   | 3          |   4% 
scipy-1.7.3          | 29.9 MB   | 6          |   6% 
scipy-1.7.3          | 29.9 MB   | 7          |   8% 
scipy-1.7.3          | 29.9 MB   | #4         |  15% 
scipy-1.7.3          | 29.9 MB   | #7         |  17% 
scipy-1.7.3          | 29.9 MB   | ##4        |  24% 
scipy-1.7.3          | 29.9 MB   | ##7        |  28% 
scipy-1.7.3          | 29.9 MB   | ###2       |  32% 
scipy-1.7.3          | 29.9 MB   | ####       |  40% 
scipy-1.7.3          | 29.9 MB   | ####4      |  45% 
scipy-1.7.3          | 29.9 MB   | #####3     |  54% 
scipy-1.7.3          | 29.9 MB   | #####8     |  59% 
scipy-1.7.3          | 29.9 MB   | ######3    |  63% 
scipy-1.7.3          | 29.9 MB   | ######9    |  69% 
scipy-1.7.3          | 29.9 MB   | #######3   |  74% 
scipy-1.7.3          | 29.9 MB   | ########   |  80% 
scipy-1.7.3          | 29.9 MB   | ########4  |  85% 
scipy-1.7.3          | 29.9 MB   | #########  |  90% 
scipy-1.7.3          | 29.9 MB   | #########5 |  95% 
scipy-1.7.3          | 29.9 MB   | ########## | 100% 
scipy-1.7.3          | 29.9 MB   | ########## | 100% 

joblib-1.0.1         | 207 KB    |            |   0% 
joblib-1.0.1         | 207 KB    | 7          |   8% 
joblib-1.0.1         | 207 KB    | ########## | 100% 
joblib-1.0.1         | 207 KB    | ########## | 100% 

intel-opencl-rt-2023 | 92.9 MB   |            |   0% 
intel-opencl-rt-2023 | 92.9 MB   |            |   0% 
intel-opencl-rt-2023 | 92.9 MB   | 3          |   4% 
intel-opencl-rt-2023 | 92.9 MB   | 7          |   7% 
intel-opencl-rt-2023 | 92.9 MB   | #          |  11% 
intel-opencl-rt-2023 | 92.9 MB   | #3         |  14% 
intel-opencl-rt-2023 | 92.9 MB   | #5         |  15% 
intel-opencl-rt-2023 | 92.9 MB   | #7         |  18% 
intel-opencl-rt-2023 | 92.9 MB   | #9         |  20% 
intel-opencl-rt-2023 | 92.9 MB   | ##1        |  22% 
intel-opencl-rt-2023 | 92.9 MB   | ##4        |  25% 
intel-opencl-rt-2023 | 92.9 MB   | ##7        |  28% 
intel-opencl-rt-2023 | 92.9 MB   | ##9        |  30% 
intel-opencl-rt-2023 | 92.9 MB   | ###1       |  32% 
intel-opencl-rt-2023 | 92.9 MB   | ###4       |  35% 
intel-opencl-rt-2023 | 92.9 MB   | ###6       |  36% 
intel-opencl-rt-2023 | 92.9 MB   | ###8       |  39% 
intel-opencl-rt-2023 | 92.9 MB   | ####1      |  41% 
intel-opencl-rt-2023 | 92.9 MB   | ####5      |  45% 
intel-opencl-rt-2023 | 92.9 MB   | ####7      |  47% 
intel-opencl-rt-2023 | 92.9 MB   | ####9      |  49% 
intel-opencl-rt-2023 | 92.9 MB   | #####3     |  53% 
intel-opencl-rt-2023 | 92.9 MB   | #####5     |  55% 
intel-opencl-rt-2023 | 92.9 MB   | #####7     |  57% 
intel-opencl-rt-2023 | 92.9 MB   | ######     |  60% 
intel-opencl-rt-2023 | 92.9 MB   | ######1    |  62% 
intel-opencl-rt-2023 | 92.9 MB   | ######4    |  65% 
intel-opencl-rt-2023 | 92.9 MB   | ######6    |  67% 
intel-opencl-rt-2023 | 92.9 MB   | ######8    |  69% 
intel-opencl-rt-2023 | 92.9 MB   | #######    |  71% 
intel-opencl-rt-2023 | 92.9 MB   | #######2   |  72% 
intel-opencl-rt-2023 | 92.9 MB   | #######3   |  74% 
intel-opencl-rt-2023 | 92.9 MB   | #######5   |  75% 
intel-opencl-rt-2023 | 92.9 MB   | #######7   |  77% 
intel-opencl-rt-2023 | 92.9 MB   | #######8   |  79% 
intel-opencl-rt-2023 | 92.9 MB   | ########1  |  81% 
intel-opencl-rt-2023 | 92.9 MB   | ########2  |  83% 
intel-opencl-rt-2023 | 92.9 MB   | ########4  |  84% 
intel-opencl-rt-2023 | 92.9 MB   | ########7  |  87% 
intel-opencl-rt-2023 | 92.9 MB   | #########  |  91% 
intel-opencl-rt-2023 | 92.9 MB   | #########2 |  92% 
intel-opencl-rt-2023 | 92.9 MB   | #########4 |  94% 
intel-opencl-rt-2023 | 92.9 MB   | #########7 |  97% 
intel-opencl-rt-2023 | 92.9 MB   | ########## | 100% 
intel-opencl-rt-2023 | 92.9 MB   | ########## | 100% 

threadpoolctl-2.2.0  | 16 KB     |            |   0% 
threadpoolctl-2.2.0  | 16 KB     | ########## | 100% 
threadpoolctl-2.2.0  | 16 KB     | ########## | 100% 

six-1.16.0           | 19 KB     |            |   0% 
six-1.16.0           | 19 KB     | ########5  |  86% 
six-1.16.0           | 19 KB     | ########## | 100% 

certifi-2022.9.24    | 158 KB    |            |   0% 
certifi-2022.9.24    | 158 KB    | #          |  10% 
certifi-2022.9.24    | 158 KB    | ###        |  30% 
certifi-2022.9.24    | 158 KB    | #########1 |  91% 
certifi-2022.9.24    | 158 KB    | ########## | 100% 

numpy-1.22.3         | 4 KB      |            |   0% 
numpy-1.22.3         | 4 KB      | ########## | 100% 
numpy-1.22.3         | 4 KB      | ########## | 100% 
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... 

    Windows 64-bit packages of scikit-learn can be accelerated using scikit-learn-intelex.
    More details are available here: https://intel.github.io/scikit-learn-intelex

    For example:

        $ conda install scikit-learn-intelex
        $ python -m sklearnex my_application.py


done

Note: you may need to restart the kernel to use updated packages.

==> WARNING: A newer version of conda exists. <==
  current version: 4.12.0
  latest version: 23.1.0

Please update conda by running

    $ conda update -n base -c defaults conda


In [5]:
!conda install -c plotly -y plotly
Collecting package metadata (current_repodata.json): ...working... done

==> WARNING: A newer version of conda exists. <==
  current version: 4.12.0
  latest version: 23.1.0

Please update conda by running

    $ conda update -n base -c defaults conda


Solving environment: ...working... done

## Package Plan ##

  environment location: C:\Users\p2112675\.conda\envs\gpuenv

  added / updated specs:
    - plotly


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    plotly-5.13.0              |             py_0         7.0 MB  plotly
    tenacity-8.0.1             |   py38haa95532_1          34 KB
    ------------------------------------------------------------
                                           Total:         7.0 MB

The following NEW packages will be INSTALLED:

  plotly             plotly/noarch::plotly-5.13.0-py_0
  tenacity           pkgs/main/win-64::tenacity-8.0.1-py38haa95532_1

The following packages will be UPDATED:

  ca-certificates                     2022.10.11-haa95532_0 --> 2023.01.10-haa95532_0
  certifi                          2022.9.24-py38haa95532_0 --> 2022.12.7-py38haa95532_0



Downloading and Extracting Packages

plotly-5.13.0        | 7.0 MB    |            |   0% 
plotly-5.13.0        | 7.0 MB    | ########## | 100% 
plotly-5.13.0        | 7.0 MB    | ########## | 100% 

tenacity-8.0.1       | 34 KB     |            |   0% 
tenacity-8.0.1       | 34 KB     | ####6      |  46% 
tenacity-8.0.1       | 34 KB     | ########## | 100% 
tenacity-8.0.1       | 34 KB     | ########## | 100% 
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done

Generative adversarial network (GAN)¶

https://machinelearningmastery.com/impressive-applications-of-generative-adversarial-networks/

  • GAN can generate images with high fidelity and are used in image upsampling, image resolution and generating more image samples for normal classifiers
  • For image generation models , GANs succeed the VAEs as they are found to create more realistic images but require longer training .
  • It consist of a generator network and discriminator network that is training in a zero sum manner, where the gain of the discrminator is the loss of the generator and vice versa

Generator¶

  • The generator learns to generate images that look real enough to fool the discriminator

Discriminator¶

  • Learns to classfies between real images from generated images
  • Usually overfits and 'overpowers' and thus does not provide useful feedback the generator making the generator unable to learn , hence it is important to ensure balance between the 2 networks.

CIFAR-10¶

  • Is a common image dataset with 50000 train and 10000 test images
  • Commonly used for testing out new Architures / methods before trying them on larger dataset
In [1]:
import tensorflow as tf
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from numpy.random import default_rng
from sklearn.manifold import TSNE
import plotly.express as px 
In [2]:
(x_train, y_train), (x_test, y_test) = tf.keras.datasets.cifar10.load_data()
assert x_train.shape == (50000, 32, 32, 3)
assert x_test.shape == (10000, 32, 32, 3)
assert y_train.shape == (50000, 1)
assert y_test.shape == (10000, 1)

Data Understanding¶

  • This is a dataset of 50000 training images and 10,000 test images
  • Each image is 32x32x3 (LxWxH)
  • Exists in both 100 classes and 20 classes of normal day objects such as apple, bed, bicycle etc
In [3]:
label_mapping={
0:'airplane' 	,									
1:'automobile' 		,								
2:'bird' 		,								
3:'cat'		,								
4:'deer' 		,								
5:'dog' 		,								
6:'frog' 		,								
7:'horse' 		,								
8:'ship' 		,								
9:'truck',}

n_classes = 100
eday_train = np.squeeze(y_train)

Overview of 10 classes¶

In [10]:
fig, axes = plt.subplots(10,10 , figsize = (16,16))


for i in range(10):
    for j in range(10 ):
        ax = axes[i,j]
            
        pic = x_train[eday_train == i ][j]
        ax.axis('off')
        ax.imshow(pic)
        ax.set_title(label_mapping[i])
    

plt.show()
  • Generally animal images are more blurry , espescially frogs and deer and horse
  • Vehicles are generally clearer
In [4]:
tsne = TSNE(n_components=2, random_state=42, verbose = 1 , n_jobs =3 , learning_rate = 500)
num_images,height,width , channels = x_train.shape
flattened_images = x_train.reshape((num_images, height*width*channels ))
reduced = tsne.fit_transform(flattened_images  )
reduced_df = pd.DataFrame(columns=['Componenent1', 'Componenent2', 'target'],
                       data=np.column_stack((reduced, 
                                            eday_train)))


# sns.scatterplot( data =reduced_df,  x= 'Componenent1' , y = 'Componenent2' , hue = 'target' )
# eda_y_train = np.squeeze(y_train)

px.scatter(reduced_df, x='Componenent1', y='Componenent2', opacity  = 0.1,
              color='target'   , width = 900 ,height= 500 ).update_layout( margin=dict(l=20, r=10, t=10, b=0) ).show()
C:\Users\p2112675\.conda\envs\tfsklearn\lib\site-packages\sklearn\manifold\_t_sne.py:795: FutureWarning: The default initialization in TSNE will change from 'random' to 'pca' in 1.2.
  warnings.warn(
[t-SNE] Computing 91 nearest neighbors...
[t-SNE] Indexed 50000 samples in 0.137s...
[t-SNE] Computed neighbors for 50000 samples in 90.760s...
[t-SNE] Computed conditional probabilities for sample 1000 / 50000
[t-SNE] Computed conditional probabilities for sample 2000 / 50000
[t-SNE] Computed conditional probabilities for sample 3000 / 50000
[t-SNE] Computed conditional probabilities for sample 4000 / 50000
[t-SNE] Computed conditional probabilities for sample 5000 / 50000
[t-SNE] Computed conditional probabilities for sample 6000 / 50000
[t-SNE] Computed conditional probabilities for sample 7000 / 50000
[t-SNE] Computed conditional probabilities for sample 8000 / 50000
[t-SNE] Computed conditional probabilities for sample 9000 / 50000
[t-SNE] Computed conditional probabilities for sample 10000 / 50000
[t-SNE] Computed conditional probabilities for sample 11000 / 50000
[t-SNE] Computed conditional probabilities for sample 12000 / 50000
[t-SNE] Computed conditional probabilities for sample 13000 / 50000
[t-SNE] Computed conditional probabilities for sample 14000 / 50000
[t-SNE] Computed conditional probabilities for sample 15000 / 50000
[t-SNE] Computed conditional probabilities for sample 16000 / 50000
[t-SNE] Computed conditional probabilities for sample 17000 / 50000
[t-SNE] Computed conditional probabilities for sample 18000 / 50000
[t-SNE] Computed conditional probabilities for sample 19000 / 50000
[t-SNE] Computed conditional probabilities for sample 20000 / 50000
[t-SNE] Computed conditional probabilities for sample 21000 / 50000
[t-SNE] Computed conditional probabilities for sample 22000 / 50000
[t-SNE] Computed conditional probabilities for sample 23000 / 50000
[t-SNE] Computed conditional probabilities for sample 24000 / 50000
[t-SNE] Computed conditional probabilities for sample 25000 / 50000
[t-SNE] Computed conditional probabilities for sample 26000 / 50000
[t-SNE] Computed conditional probabilities for sample 27000 / 50000
[t-SNE] Computed conditional probabilities for sample 28000 / 50000
[t-SNE] Computed conditional probabilities for sample 29000 / 50000
[t-SNE] Computed conditional probabilities for sample 30000 / 50000
[t-SNE] Computed conditional probabilities for sample 31000 / 50000
[t-SNE] Computed conditional probabilities for sample 32000 / 50000
[t-SNE] Computed conditional probabilities for sample 33000 / 50000
[t-SNE] Computed conditional probabilities for sample 34000 / 50000
[t-SNE] Computed conditional probabilities for sample 35000 / 50000
[t-SNE] Computed conditional probabilities for sample 36000 / 50000
[t-SNE] Computed conditional probabilities for sample 37000 / 50000
[t-SNE] Computed conditional probabilities for sample 38000 / 50000
[t-SNE] Computed conditional probabilities for sample 39000 / 50000
[t-SNE] Computed conditional probabilities for sample 40000 / 50000
[t-SNE] Computed conditional probabilities for sample 41000 / 50000
[t-SNE] Computed conditional probabilities for sample 42000 / 50000
[t-SNE] Computed conditional probabilities for sample 43000 / 50000
[t-SNE] Computed conditional probabilities for sample 44000 / 50000
[t-SNE] Computed conditional probabilities for sample 45000 / 50000
[t-SNE] Computed conditional probabilities for sample 46000 / 50000
[t-SNE] Computed conditional probabilities for sample 47000 / 50000
[t-SNE] Computed conditional probabilities for sample 48000 / 50000
[t-SNE] Computed conditional probabilities for sample 49000 / 50000
[t-SNE] Computed conditional probabilities for sample 50000 / 50000
[t-SNE] Mean sigma: 620.533136
[t-SNE] KL divergence after 250 iterations with early exaggeration: 107.371880
[t-SNE] KL divergence after 1000 iterations: 4.127415
In [20]:
reduced_df.target=reduced_df.target.astype('int').apply(lambda x: label_mapping[x])
In [22]:
reduced_df
plt.figure( figsize=(16,9))
sns.scatterplot(data =reduced_df , x = 'Componenent1' , y = 'Componenent2'  , hue = 'target' , palette= sns.color_palette())
plt.show()

TSNE¶

  • TSNE is a method for visualising high dimensional data using manifolds
  • Images are flattend and passed into tsne

  • Air planes are well seperated from the rest of the classes occupying hte top left corner

  • Frogs and cats overlap with a lot of other classes and very widely spread out accross the space
  • Automobile also spread out across the space

  • Truck and ship more distinct from the rest (occupying the bottom left hand corner), but overlap with each other

In [14]:
eda_y_train = np.squeeze(y_train)

counts = pd.Series(eda_y_train).apply(label_mapping.get).value_counts()
plt.figure(figsize = (10, 10))
plt.barh(counts.index, counts )
plt.title('Check for Class Imbalance')
plt.ylabel('Class')
plt.xlabel('Number of images')
plt.show()
  • The cifar 10 dataset has 5000 images per class which is sufficient but we have to take note of the discriminator overfitting and not providing useful feedback as cifar10 is still considered a small dataset by the community

Average image per class¶

  • Classes that are less similar will be more blurry and vice versa
In [24]:
fig, ax = plt.subplots(1,10, figsize = ( 32,10))
for idx, a in enumerate(ax):
    img = np.mean(x_train[np.squeeze(y_train== idx)], axis =0 )/255
    a.imshow(img)
    a.set_title(label_mapping[idx])
    a.axis('off')
  • The automobile and horse looks slight more clear, showing that within the classes the images look more similar
  • Airplane, ship and truck images looks to be more in the center, which will make it easier for the gan to gererate the images there
  • Cat, dog and frog images seem to have higher variaty as it looks very blurry, cannot see even a siluolette of a these animals
In [ ]:
 
In [ ]:
m = umap.UMAP(n_components=2, random_state=42)
num_images,height,width , channels = x_train.shape
flattened_images = x_train.reshape((num_images, height*width*channels ))
reduced = m.fit_transform(flattened_images  )
reduced_df = pd.DataFrame(columns=['Componenent1', 'Componenent2', 'target'],data=np.column_stack((reduced,y_train_20)))
reduced_df.target = reduced_df.target.astype('str')
# sns.scatterplot( data =reduced_df,  x= 'Componenent1' , y = 'Componenent2' , hue = 'target' )
# eda_y_train = np.squeeze(y_train)

Modelling - Data Preprocessing (code in the notebooks that contain the models)¶

Get the pixel values by (img -127.5)/127.5 to get the images in the range of -1 and 1 so that the scale of real images is the same as the generated images passing through the last layer of tanh from -1 to 1 .

Metrics¶

Frechet inception distance (FID)¶

https://arxiv.org/abs/1706.08500

  • Most common metric for evaluating GAN
  • The fid is a metric that compares the difference in mean and variance (of real and generated images) of the image features extracted by InceptionV3.
  • It is more reliable then its predecessor the Inception Score which only calculates based on the
  • As it uses both mean and variance of the features, a low FID is only achieved when the images have similar quality and diversity to the cifar10 dataset.
  • It assumes a gaussian distribution
  • FID can be biased for small datasets like cifar10

Kernel inception distance (KID)¶

https://arxiv.org/pdf/2206.10935.pdf#:~:text=The%20Kernel%20Inception%20Distance%20

  • Measures the Maximum Mean Discrepancy between the real and generated

  • The KID improves on the FID by relaxing the gaussian requirement as it is a non parametric test

To continue, Please kindly refer to the baseline notebook on BCEGAN¶